package com.test;

import com.test.entity.Order;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 韦存滨
 * @className orderController
 * @description
 * @date 2022年11月28日 23:21
 */
@RestController
@RequestMapping("order")
public class OrderController {
    @RequestMapping("{userId}")
    public List<Order> listByUserId(@PathVariable String userId){
        Order order = new Order(userId,"orderid","订单标题1");
        Order order2 = new Order(userId,"orderid2","订单标题2");
        ArrayList<Order> orders = new ArrayList<>();
        orders.add(order);
        orders.add(order2);
        return orders;
    }
}